{% if url == '/my_favourite' or url=='/bd/my_rent_publish'%}
{% extends "info.html" %}
{% else %}
{% extends "base.html" %}
{% endif%}
{% block content %}

<div class="row" style="overflow:hidden; text-overflow:ellipsis;">
    <div class="col-md-10">
        <div class="box">
            <div class="box-header with-border">
                <table >
                    <tr>
                        {% if areas%}
                        <th>区域</th>
                        <td>{% for area in areas%}
                            <a href="/bd/view_rents?area_id={{area.id}}">
                                {{area.name}}</a>&nbsp;
                            {% endfor %}</td>
                        {% endif %}
                    </tr>
                    <tr>
                        {% if subways%}
                        <th>地铁线路&nbsp;&nbsp;&nbsp;</th>
                        <td>{% for subway in subways%}
                            <a href="/bd/view_rents?subway_id={{subway.id}}">
                                {{subway.name}}</a>&nbsp;&nbsp;
                            {% endfor%}</td>
                        {% endif %}
                    </tr>
                    <tr>
                        {% if subways or areas%}
                        <th>租金&nbsp;&nbsp;&nbsp;</th>
                        <td class="link">
                            <a href="/bd/view_rents?price=600">
                                600元以下
                            </a>
                            <a href="/bd/view_rents?price=1000">
                                600-1000元
                            </a>
                            <a href="/bd/view_rents?price=1500">
                                1000-1500元
                            </a>
                            <a href="/bd/view_rents?price=2000">
                                1500-2000元
                            </a>
                            <a href="/bd/view_rents?price=3000">
                                2000-3000元
                            </a>
                            <a href="/bd/view_rents?price=5000">
                                3000-5000元
                            </a>
                            <a href="/bd/view_rents?price=8000">
                                5000-8000元
                            </a>
                            <a href="/bd/view_rents?price=8001">
                                8000元以上
                            </a>
                        </td>
                        {% endif %}
                    </tr>
                </table>
            </div><!-- /.box-header -->

            <div class="box-body">
                <table class="table table-bordered">
                    <tr>
                        <th style="width: 20px"></th>
                        <th>标题</th>
                        <th>描述</th>
                        <th>地址</th>
                        <th>区县</th>
                        <th>地铁线</th>
                        <th>发布日期</th>
                        <th style="width: 40px"></th>
                    </tr>
                    {% if rents %}
                    {% for f in rents %}
                    <tr>
                        <td>
                            <img src='{{"/bd/web/static/"+f.rentimages.file}}' alt='{{f.rentimages.file}}' height="80" width="80"/>
                        </td>
                        <td>
                            <a href="/view_rent?id={{f.id}}">
                                {{f.title}}
                            </a>
                        </td>
                        <td>
                            {{f.description}}
                        </td>
                        <td>
                            {{f.address}}
                        </td>
                        <td>
                            {{f.area.name}}
                        </td>
                        <td>
                            {{f.subway.name}}
                        </td>
                        <td>
                            {{f.date}}
                        </td>
                        <td>
                            <form action="" method="post" name="edit_school" onsubmit="return confirm('确认要提交吗?');">
                                <input type="hidden" name="id" value="{{f.id}}">
                                {% if current_user.role_id == 1%}<input type="submit" value="删除" name="delete">{% endif%}
                            </form>
                        </td>
                    </tr>
                    {% endfor %}
                    {% endif %}

                </table>

            </div><!-- /.box-body -->
            <div class="box-footer clearfix">
                <ul class="pagination pagination-sm no-margin pull-right">
                    {% if paging %}
                    <li><a href="javascript:genPagingRef('{{url}}?page=1');">&laquo;</a></li>
                    {% for i in range(paging.page_from,paging.page_to+1) %}

                    <li><a href="javascript:genPagingRef('{{url}}?page={{i}}');">{{i}}</a></li>

                    {% endfor %}
                    <li><a href="javascript:genPagingRef('{{url}}?page={{paging.total_pages}}');">&raquo;</a></li>
                    {% endif %}

                </ul>
            </div>
        </div><!-- /.box -->
    </div>
</div>






{% endblock %}
